package com.yh.patterns.combination.demo;

import java.util.ArrayList;
import java.util.List;

/**
 * @Auther:云尚学Java
 */
public class Organization extends OrganizationComponent{

    //菜单可以有多个子菜单或者子菜单项
    private List<OrganizationComponent> organizationComponentList=new ArrayList<OrganizationComponent>();

    //构造方法
    public Organization(String name,int level) {
        this.name=name;
        this.level=level;
    }
    @Override
    public void add(OrganizationComponent organizationComponent) {
        super.add(organizationComponent);
    }

    @Override
    public void remove(OrganizationComponent organizationComponent) {
        super.remove(organizationComponent);
    }

    @Override
    public OrganizationComponent getChild(int index) {
        return super.getChild(index);
    }

    @Override
    public String getName() {
        return super.getName();
    }
}
